using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.Smart
{
    /// <summary>
    /// 用户信息实体类
    /// </summary>
    [Table("User")]
    public class User
    {
        /// <summary>
        /// 用户唯一标识 - 主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; } = string.Empty;

        /// <summary>
        /// 手机号 (可选)
        /// </summary>
        [StringLength(20)]
        public string? Phone { get; set; }

        /// <summary>
        /// 邮箱 (可选)
        /// </summary>
        [StringLength(100)]
        [EmailAddress]
        public string? Email { get; set; }

        /// <summary>
        /// 头像 URL
        /// </summary>
        [StringLength(255)]
        public string? Avatar { get; set; }

        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;


        /// <summary>
        /// 用户状态 - true=正常, false=禁用
        /// </summary>
        public bool Status { get; set; } = true;

        /// <summary>
        /// 是否删除 - 软删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;

    }
} 